import matplotlib.pyplot as plt
import numpy as np
from matplotlib import ticker

from experiments.experiments1 import load_list_from_file

# 示例数据
x = range(1,201)  # X 轴数据
y_iris = load_list_from_file("../data_result/iris.txt") # Y 轴数据
y_cifar10 = load_list_from_file("../data_result/cifar10.txt") # Y 轴数据
y_mnist = load_list_from_file("../data_result/mnist.txt") # Y 轴数据
y_fashion_mnist = load_list_from_file("../data_result/fashion_mnist.txt") # Y 轴数据
y_lstm = load_list_from_file("../data_result/lstm.txt") # Y 轴数据
# 创建折线图
plt.plot(x, y_iris, linestyle='-', label='iris')
plt.plot(x, y_cifar10, linestyle='-', label='cifar10')
plt.plot(x, y_mnist, linestyle='-', label='mnist')
plt.plot(x, y_fashion_mnist, linestyle='-', label='fashion_mnist')
plt.plot(x, y_lstm, linestyle='-', label='sentiment')
# 添加标题和标签
plt.title('Simple sample scale in validation set')
plt.xlabel('epoch')
# 设置 y 轴刻度
plt.ylabel('rate')
# 添加图例
plt.legend()

# 显示图形
plt.show()
